package com.polaris.live.adapter.party

import android.annotation.SuppressLint
import com.blankj.utilcode.util.ColorUtils
import com.blankj.utilcode.util.StringUtils
import com.polaris.live.R
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterMemberHeaderBinding
import com.polaris.live.translation.R.*

/**
 * RoomInfoMemberAdapter头部
 *
 * @author Created by 天晴 on 2024/9/25/004 12:03
 */
class RoomInfoMemberHeaderAdapter : BaseBindingAdapter<AdapterMemberHeaderBinding, Int>() {
    private var counts = 0

    @SuppressLint("SetTextI18n")
    override fun convert(holder: VBViewHolder<AdapterMemberHeaderBinding>, item: Int) {
        holder.vb.apply {
            when (item) {
                1 -> {
                    name.setTextColor(ColorUtils.getColor(R.color.color_ff8c00))
                    name.text = StringUtils.getString(string.homeowner_string)
                }

                2 -> {
                    name.setTextColor(ColorUtils.getColor(R.color.color_00b7ff))
                    name.text = "${StringUtils.getString(string.administrator)}:$counts"
                }

                3 -> {
                    name.setTextColor(ColorUtils.getColor(R.color.color_9b9b9b))
                    name.text = "${StringUtils.getString(string.member)}:$counts"
                }

            }
        }
    }

    fun setCount(count: Int) {
        this.counts = count
        notifyDataSetChanged()
    }

}